Package Management

Package management overview(/etc/apt):

  • /etc/apt/
  • The apt tool in kali manages software packages and sources. Instead of using dpkg, apt lets you install, update, and remove software easily and securely. Repositories can be added manually or with add-apt-repository. Adding trusted GPG keys ensures the software’s authenticity. For example, to install Sublime Text (not in default repos), you add its repository and GPG key so it stays updated with your system.
sudo apt autoremove [package-name]
sudo apt perge [packege-name] # removes app and its packages (Everything)
sudo apt install [package-name]
sudo apt update -y
sudo apt list --upgradable
sudo apt upgrade -y
sudo apt search [Packagename] # search packagname
  • dpkg package installer .deb:
    sudo dpkg -i app.deb

  • since subline text editor is not part kali Linux default repositories. When adding software, the integrity of what we download is guaranteed by the use of what is called GPG (Gnu Privacy Guard) keys. These keys are essentially a safety check from the developers saying, "here's our software". If the keys do not match up to what your system trusts and what the developers used, then the software will not be downloaded.

13-41-28-linux-31-Jul-2025.png

  1. Let's download the GPG key and use apt-key to trust it:
- wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/sublimehq-archive-keyring.gpg > /dev/null

- echo "deb [signed-by=/usr/share/keyrings/sublimehq-archive-keyring.gpg] https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

- sudo apt update && sudo apt install sublime-text

13-51-55-linux-31-Jul-2025.png
13-53-55-linux-31-Jul-2025.png

The Update and Upgrade

patching is best practice.
#resources/linux/basics

how the update and upgrading work ?
  • the update will look for the well known Repositories then the upgrade will patch to new version of application running on the machine.

  • lets try it out

  • Some updates require Root privilege's to execute: as u can see in this image these are the old packages
    Pasted image 20250619000620.png

these are the new packages
Pasted image 20250619000840.png
Pasted image 20250619000634.png

run auto-remove the old packages

sudo apt autoremove

install a package

sudo apt install packagename

delete package:

sudo apt purge packagename

getting tools from GitHub
-is easy just by getting the GitHub link to clone it to your folder example: git clone
best folder to store your /opt directory so u know where to find it.

Note: always check the user profile if there legit over 700 stars they are safe.

Example of git repos
(1) package fixer for kali if there broken packages
sudo git clone <Link>
Pasted image 20250619001012.png

/opt:
this directory in Kali Linux is a default directory used to store optional add-ons or packages. It's a common directory in Linux systems where third-party software is installed.